package com.xyx.www;
import java.util.Scanner;



 interface  Zm1{
	 //实现的接口
	public void  choseChar(); 
	
}
public abstract  class Test0719 implements Zm1 {
	private void testA() {
		int i0 = 0;
		int i1 = 1;
		int i2 = 2;
		int i3 = 4;
		int i4 = 5;
		//  1+1+1+1+1+2+3+3*4+4*5    从左往右开始执行
		// 混合逻辑短路                                 F             T      T      T(发生短路)        
		boolean isOk3 = ++i0 > i1++ || ++i1 > i2 && i4 > i3++ || ++i3 > i4++ || i4 > i3 && i3-- > --i4; // true
		// i0 =1 ,i1=3, i2 = 2,i3 =5 ,i4 = 5
		System.out.println("isOk3=" + isOk3);
		System.out.println("i0=" + i0 + ",i1=" + i1 + ",i2=" + i2 + ",i3=" + i3 + ",i4=" + i4);
		int i=1;
		i=i++;
		System.out.println(i);
		Scanner sc=new Scanner(System.in);
		int aplNum=1;
		int stuNum=1;
		double stuApple=2.0;
		aplNum=sc.nextInt();
		stuNum=sc.nextInt();
		stuApple=aplNum/stuNum;
		System.out.println("个数为"+stuApple);
		
	}
	public static void choseChar(int s) {
		 System.out.println("\t"+"结果如下");
		 int line=s;
			if(line%2==0) {
			for(int i8=0;i8<line;i8++) { 
				
				for(int i9=0;i9<i8+1;i9++) {
					
					System.out.print("*");
				}
				System.out.println();
				}
			}
			else {
			        for(int m = 1; m <=(line+1)/2; m++)
			        {
			            for(int b = 1; b <=(line+1)/2-m ; b++)
			            {
			                System.out.print(" ");
			            }
			            for(int c = 1; c <= m*2-1; c++)
			            {
			                System.out.print("*");    
			            }
			            System.out.println();
			           
			        }
			        for(int d =(line+1)/2-1;d >= 1; d --)
			        {
			            for(int b = 1; b <= (line+1)/2-d; b++)
			            {
			                System.out.print(" ");
			            }
			            for(int c = (line+1)/2-d; c <=(line+1)/2-2+d; c ++)
			            {
			                System.out.print("*");    
			            }
			            System.out.println();
			        	}
			       }	
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		 System.out.println("输入行数");
		  int numLine=sc.nextInt();
		choseChar(numLine);
		char choseY;
     do {
 		System.out.println("是否继续(y/n)");
        String  choseYn= sc.next();
          choseY=choseYn.charAt(0);
        switch(choseY) {
        case 'y':
        	 System.out.println("再次输入行数");
        	int numLine2=sc.nextInt();
        	choseChar(numLine2);
        	break;
        case 'n':
    System.out.println("程序结束");
        }
     }while(choseY=='y');
		    }
		}



